home *** CD-ROM | disk | FTP | other *** search
- unit StringsEditorFormU;
-
- {$ifdef Ver100} { Delphi 3.0x }
- {$define DelphiLessThan4}
- {$define DelphiLessThan5}
- {$endif}
- {$ifdef Ver110} { C++ Builder 3.0x }
- {$define DelphiLessThan4}
- {$define DelphiLessThan5}
- {$endif}
- {$ifdef Ver120} { Delphi 4.0x }
- {$define DelphiLessThan5}
- {$endif}
-
- interface
-
- uses
- TypInfo,
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TStringsEditorForm = class(TForm)
- memTStrings: TMemo;
- btnOK: TButton;
- btnCancel: TButton;
- procedure btnOKClick(Sender: TObject);
- private
- FPropInfo: PPropInfo;
- FObject: TObject;
- public
- constructor Create(Obj: TObject; PropInfo: PPropInfo);
- {$ifndef DelphiLessThan4}reintroduce;{$endif}
- end;
-
- var
- StringsEditorForm: TStringsEditorForm;
-
- implementation
-
- {$R *.DFM}
-
- uses
- PropertyHelper;
-
- { TStringsEditorForm }
-
- constructor TStringsEditorForm.Create(Obj: TObject; PropInfo: PPropInfo);
- begin
- inherited Create(Application);
- FObject := Obj;
- FPropInfo := PropInfo;
- memTStrings.Lines := GetObjectProp(FObject, FPropInfo, TStrings) as TStrings;
- end;
-
- procedure TStringsEditorForm.btnOKClick(Sender: TObject);
- begin
- SetObjectProp(FObject, FPropInfo, memTStrings.Lines)
- end;
-
- end.
-